home *** CD-ROM | disk | FTP | other *** search
-
- function units_amphibia_alien_setup()
- units_setup(4,true,ENET_EFFECT_PS_SETUPSMOKE_MEDIUM,ENET_EFFECT_GEOMETRY_AMPHIBIAALIENSHADOW)
- uniGetExecutor():addSimpleEffect(ENET_EFFECT_PS_ENVIRONMENT_AMPHIBIASMOKE)
-
- end
-
- function units_amphibia_alien_resetup()
- units_setup(4,true,nil,ENET_EFFECT_GEOMETRY_AMPHIBIAALIENSHADOW)
- uniGetExecutor():addSimpleEffect(ENET_EFFECT_PS_ENVIRONMENT_AMPHIBIASMOKE)
- end
-
- function units_amphibia_alien_select()
- units_select(22,1)
- end
-
- function units_amphibia_alien_unselect()
- units_unselect()
- end
-
- function units_amphibia_alien_selectenemy()
- uniGetExecutor():addSimpleEffect(ENET_EFFECT_SELECTEDGEOMETRY_ENEMY)
- end
-
- function units_amphibia_alien_damaged()
- uniGetExecutor():applyDamage(uniGetLife())
- end
-
- function units_amphibia_alien_highlight()
- uniGetExecutor():addEffectWithRadius(ENET_EFFECT_GEOMETRY_HIGHLIGHT,15)
- end
-
- function units_amphibia_alien_explode()
- units_explode_small3_green()
- end
-
- function units_amphibia_alien_move()
- local unit = uniGetExecutor()
- local sound = unit:play3DSound("amphibia_alien_move.wav",1)
- unit:getBone(ENBT_GUNTOWER):addRotationEffect(ENET_EFFECT_ROTATE_GUNTOWERDEFAULT,MATH_PI)
- local eng_smoke = unit:addSimpleEffect(ENET_EFFECT_PS_ENVIRONMENT_AMPHIBIASMOKE)
- local eng_smoke2 = unit:addSimpleEffect(ENET_EFFECT_PS_NEWTRACKSMOKE4)
- waitDeath(unit:addRotationEffect(ENET_EFFECT_ROTATE_UNIT,MATH_PI * 1.0))
- waitDeath(unit:addMoveEffect(ENET_EFFECT_MOVE_LINEAR,100))
- eng_smoke:suspendedDestroy(2.0)
- eng_smoke2:suspendedDestroy(5.0)
- sound:destroy()
- unit:play3DSound("amphibia_alien_stop.wav",0):destroy()
- end
-
- function units_amphibia_alien_fire()
- local unit = uniGetExecutor()
- uniSetLife(uniGetLife() / 2.0)
- local gt = unit:getBone(ENBT_GUNTOWER)
- local gun = gt:getBone(ENBT_GUN)
- local sound = gt:play3DSound("amphibia_alien_guntower_rotate.wav",1)
- waitDeath(gt:addRotationEffect(ENET_EFFECT_ROTATE_GUNTOWERTOTARGET,MATH_PI,uniGetTarget()))
- waitDeath(gun:addRotationEffect(ENET_EFFECT_ROTATE_GUNTOTARGET,MATH_PI / 3.0,uniGetTarget()))
- sound:stopSound()
- gt:play3DSound("machinegunburstfire.wav",0):destroy()
- local firespots = {}
- firespots[0] = gt:getBone(ENBT_FIRE1,0)
- firespots[1] = gt:getBone(ENBT_FIRE1,1)
- firespots[0]:addSimpleEffect(ENET_EFFECT_LIGHT_MACHINEGUNFIRE):delayedDestroy(2.0)
- local pss = {}
- pss[0] = firespots[0]:addSimpleEffect(ENET_EFFECT_PS_MACHINEGUNFIRE)
- pss[1] = firespots[1]:addSimpleEffect(ENET_EFFECT_PS_MACHINEGUNFIRE)
- firespots[0]:addBulletEffect(ENET_EFFECT_BULLET_MACHINEGUNFIRE):executeCommand(ENC_FIRE1)
- firespots[1]:addBulletEffect(ENET_EFFECT_BULLET_MACHINEGUNFIRE):executeCommand(ENC_FIRE1)
- pause(1.0)
- pss[0]:suspendedDestroy(1.0)
- pss[1]:suspendedDestroy(1.0)
- unit:addFireArrow()
- end
-
- registerCommand(ENSCRIPTSET_AMPHIBIA_ALIEN,ENC_MOVE,"units_amphibia_alien_move")
- registerCommand(ENSCRIPTSET_AMPHIBIA_ALIEN,ENC_FIRE1,"units_amphibia_alien_fire")
- registerCommand(ENSCRIPTSET_AMPHIBIA_ALIEN,ENC_FIRE2,"units_amphibia_alien_fire")
- registerCommand(ENSCRIPTSET_AMPHIBIA_ALIEN,ENC_SELECT,"units_amphibia_alien_select")
- registerCommand(ENSCRIPTSET_AMPHIBIA_ALIEN,ENC_SELECTENEMY,"units_amphibia_alien_selectenemy")
- registerCommand(ENSCRIPTSET_AMPHIBIA_ALIEN,ENC_UNSELECT,"units_amphibia_alien_unselect")
- registerCommand(ENSCRIPTSET_AMPHIBIA_ALIEN,ENC_SETUP,"units_amphibia_alien_setup")
- registerCommand(ENSCRIPTSET_AMPHIBIA_ALIEN,ENC_RESETUP,"units_amphibia_alien_resetup")
- registerCommand(ENSCRIPTSET_AMPHIBIA_ALIEN,ENC_DAMAGED,"units_amphibia_alien_damaged")
- registerCommand(ENSCRIPTSET_AMPHIBIA_ALIEN,ENC_EXPLODE,"units_amphibia_alien_explode")
- registerCommand(ENSCRIPTSET_AMPHIBIA_ALIEN,ENC_HIGHLIGHT,"units_amphibia_alien_highlight")
- registerCommand(ENSCRIPTSET_AMPHIBIA_ALIEN,ENC_INSIDE,"units_inside")
-
- -- make description of unit
- desc = getEffectDescriptionP(ENET_UNIT_AMPHIBIA_ALIEN)
- desc.ClassID = ENCLASS_MESHINSTANCE
- desc.EffectClassType = ENECT_GEOMETRY
- desc.FileName = "amphibia_alien.rmd"
- desc.ScriptSet = ENSCRIPTSET_AMPHIBIA_ALIEN
- desc.MoveType = ENMOVE_AMPHIBIAN
- desc.RenderType = ENRENDERTYPE_GEOMETRY
- desc.Material = ENMAT_RIGIDSKINNEDMESH
- desc.MaterialColors = units_materialcolors_human
-
- -- shadow
- desc = getEffectDescriptionP(ENET_EFFECT_GEOMETRY_AMPHIBIAALIENSHADOW)
- desc.ClassID = ENCLASS_MESHINSTANCE
- desc.EffectClassType = ENECT_GEOMETRY
- desc.FileName = "amphibia_alien_shadow.rmd"
- desc.RenderType = ENRENDERTYPE_SHADOW
- desc.Material = ENMAT_SHADOW
- desc.MaterialColors = units_materialcolors_shadow
-
- -- register new unit to logic
- unitDesc = logic_getUnitDescP(20)
- unitDesc.group = 1
- unitDesc.order = 1
- unitDesc.unit_res_id = ENET_UNIT_AMPHIBIA_ALIEN
- unitDesc.unit_icon_id = "Amphibia_a_small_normal.dds"
- unitDesc.active_id = "Amphibia_a_small_active.dds"
- unitDesc.pressed_id = "Amphibia_a_small_pressed.dds"
- unitDesc.small_icon_id = "Amphibia_l_stats.dds"
- unitDesc.big_icon_id = "Amphibia_a_big_normal.dds"
- unitDesc.HP = 4
- unitDesc.MP = 30
- unitDesc.WR = 1
- unitDesc.min_WR = 1
- unitDesc.WD = 2
- unitDesc.WR2 = 0
- unitDesc.min_WR2 = 0
- unitDesc.WD2 = 0
- unitDesc.ability = 2
- unitDesc.transport = 0
- unitDesc.value = 3
- unitDesc.race = 1
- unitDesc.fire_pause = 0.75
- unitDesc.move_pause = 1.0
- unitDesc.unit_info_scale = 0.06
- unitDesc.scn_name = "AMPHIBIAA"
-
- ------------------------------------------------------------------------------------------------------
- ------------------------ effects related to unit------------------------------------------------------
- ------------------------------------------------------------------------------------------------------
-
- function bullets_machinegun_fire()
- local bullet = uniGetExecutor()
- bullet:setTransformOwner()
- waitDeath(bullet:addMoveEffect(ENET_EFFECT_MOVE_LINEARFLY,2000,uniGetTarget()),1000)
- local light = bullet:addSimpleEffect(ENET_EFFECT_LIGHT_MACHINEGUNFIREHIT)
- local hit_ps = bullet:addSimpleEffect(ENET_EFFECT_PS_MACHINEGUNFIREHIT)
- pause(1.0)
- uniGetTarget():executeCommand(ENC_DAMAGED)
- light:destroy()
- hit_ps:suspendedDestroy(1.0)
- pause(1.0)
- bullet:destroy()
- end
-
- registerCommand(ENSCRIPTSET_BULLET_MACHINEGUNFIRE,ENC_FIRE1,"bullets_machinegun_fire")
-